<!--/**
* Author: ganqz
* Date: 2024-06-27 16:52
* Desc: CustomerComponent
*/
-->
<template>
  <app-container>
    <app-block is-search>
      <zm-form ref="searchForm" inline :model="searchForm" size="small">
        <zm-form-item label="类型:" prop="name">
          <zm-data-select
            v-model="searchForm.name"
            k1=""
            placeholder="请选择"
            disabled-value="pos,offline"
          />
        </zm-form-item>
        <zm-form-item prop="name" label="名称:">
          <zm-input
            v-model="searchForm.name"
            class="w200"
            placeholder="请输入"
          />
        </zm-form-item>
        <zm-form-item props="endTime" label="日期">
          <zm-date-picker
            :target="searchForm"
            start-key="startTime"
            end-key="endTime"
          />
        </zm-form-item>
        <zm-form-item>
          <zm-button t="search" @click="onSearch" />
          <zm-button t="reset" @click="onReset" />
          <zm-button t="add" @click="onNew" />
        </zm-form-item>
      </zm-form>
    </app-block>
    <app-block>
      <zm-table-data
        :data="tableParams.data"
        :columns="columns"
        :fetch="loadList"
        :table-params="tableParams"
      />
    </app-block>
    <NewCustomerComponent
      v-if="showNew"
      v-model="showNew"
      :obj="currentItem"
      @after-save="afterSave"
    />
  </app-container>
</template>

<script>
import tableMixin from '@/mixins/zmTableMixin'
import { columns } from './const'
// import systemAccountApis from '@/api/src/systemAccount'
export default {
  name: "CustomerComponent",
  components: {},
  mixins: [tableMixin],
  data() {
    return {
      showNew: false,
      currentItem: {},
      searchForm: {
        name: ''
      }
    }
  },
  computed: {
    columns() {
      return columns(this)
    }
  },
  watch: {},
  created() {},
  methods: {
    async loadList() {
      // const _res = await systemAccountApis.getPageList(
      //   this.assignQuery(this.searchForm)
      // )
      // this.initialTableData(_res.list, _res.count)
    },
    afterSave() {},
    onNew() {
      this.showNew = true
    }
  }
}
</script>
